org.eclipse.vtp.desktop.projects.core.internals
Class MediaFolder

java.lang.Object
  extended by org.eclipse.vtp.desktop.projects.core.internals.VoiceResource
      extended by org.eclipse.vtp.desktop.projects.core.internals.MediaResource
          extended by org.eclipse.vtp.desktop.projects.core.internals.MediaFolder
All Implemented Interfaces:
org.eclipse.core.runtime.IAdaptable, IMediaContainer, IMediaFolder, IMediaResource, ObjectListener, IVoiceToolsResource

public class MediaFolder
extends MediaResource
implements IMediaFolder

This is a concrete implementation of IMediaFilesFolder and provides the default behavior of that interface.

Version:
2.0
Author:
Trip Gilman

Constructor Summary
MediaFolder(IMediaContainer container, org.eclipse.core.resources.IFolder folder)
          Creates a new MediaFolder in the provided container with the given eclipse folder resource.
 
Method Summary
 IMediaFile create(java.lang.String name)
          Creates a new media file with the given name.
 IMediaFile create(java.lang.String name, java.io.InputStream source, org.eclipse.core.runtime.IProgressMonitor monitor)
          Creates a new media file with the given name.
 java.lang.Object[] getChildren(java.lang.Object o)
           
 org.eclipse.jface.resource.ImageDescriptor getImageDescriptor(java.lang.Object object)
           
 IMediaFile getMediaFile(java.lang.String name)
          Locates the media file with the given name.
 IMediaFolder getMediaFolder(java.lang.String name)
          Locates the media folder with the given name.
 java.util.List listMediaResources()
           
 IMediaFolder makeDirectory(java.lang.String name)
          Creates a new media folder with the given name.
 
Methods inherited from class org.eclipse.vtp.desktop.projects.core.internals.MediaResource
delete, exists, getMediaPath, getName, getObjectId, getParent, getParentMediaContainer
 
Methods inherited from class org.eclipse.vtp.desktop.projects.core.internals.VoiceResource
addRefreshListener, deferEvents, finalize, getAdapter, getProject, processObjectEvent, refresh, removeRefreshListener, resumeEvents
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.vtp.desktop.projects.core.IMediaResource
delete, exists, getMediaPath, getParentMediaContainer
 
Methods inherited from interface org.eclipse.vtp.desktop.projects.core.IVoiceToolsResource
addRefreshListener, deferEvents, getName, getParent, getProject, refresh, removeRefreshListener, resumeEvents
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 
Methods inherited from interface org.eclipse.vtp.desktop.projects.core.IVoiceToolsResource
addRefreshListener, deferEvents, getName, getParent, getProject, refresh, removeRefreshListener, resumeEvents
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Constructor Detail

MediaFolder

public MediaFolder(IMediaContainer container,
                   org.eclipse.core.resources.IFolder folder)
Creates a new MediaFolder in the provided container with the given eclipse folder resource.

Parameters:
container - The parent media container
folder - The eclipse folder resource this media folder represents
Method Detail

listMediaResources

public java.util.List listMediaResources()
                                  throws org.eclipse.core.runtime.CoreException
Specified by:
listMediaResources in interface IMediaContainer
Returns:
The list of IMediaResources contained by this media folder resource
Throws:
org.eclipse.core.runtime.CoreException - If an error occured while enumerating the media resources

getMediaFolder

public IMediaFolder getMediaFolder(java.lang.String name)
Description copied from interface: IMediaContainer
Locates the media folder with the given name.

Specified by:
getMediaFolder in interface IMediaContainer
Parameters:
name - The name of the desired media folder
Returns:
The desired media folder or null if not found

getMediaFile

public IMediaFile getMediaFile(java.lang.String name)
Description copied from interface: IMediaContainer
Locates the media file with the given name.

Specified by:
getMediaFile in interface IMediaContainer
Parameters:
name - The name of the desired media file
Returns:
The desired media file or null if not found

create

public IMediaFile create(java.lang.String name)
                  throws org.eclipse.core.runtime.CoreException
Description copied from interface: IMediaContainer
Creates a new media file with the given name. The created file will be initially empty (0 length).

Specified by:
create in interface IMediaContainer
Parameters:
name - The name of the new media file
Returns:
The newly created media file
Throws:
org.eclipse.core.runtime.CoreException - If an error occured while creating the new media file

create

public IMediaFile create(java.lang.String name,
                         java.io.InputStream source,
                         org.eclipse.core.runtime.IProgressMonitor monitor)
                  throws org.eclipse.core.runtime.CoreException
Description copied from interface: IMediaContainer
Creates a new media file with the given name. It's initial contents will be retrieved from the provided input stream. The progress monitor will be used to provide user feedback during the operation.

Specified by:
create in interface IMediaContainer
Parameters:
name - The name of the new media file
source - The initial contents of the file
monitor - A progress monitor for user feedback
Returns:
The newly created media file
Throws:
org.eclipse.core.runtime.CoreException - If an error occured while creating the new media file

makeDirectory

public IMediaFolder makeDirectory(java.lang.String name)
                           throws org.eclipse.core.runtime.CoreException
Description copied from interface: IMediaContainer
Creates a new media folder with the given name.

Specified by:
makeDirectory in interface IMediaContainer
Parameters:
name - The name of the new media folder
Returns:
The newly created media folder
Throws:
org.eclipse.core.runtime.CoreException - If an error occured while creating the media folder

getChildren

public java.lang.Object[] getChildren(java.lang.Object o)

getImageDescriptor

public org.eclipse.jface.resource.ImageDescriptor getImageDescriptor(java.lang.Object object)